package cn.yunhe.biz.impl;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import cn.yunhe.biz.IMessageBiz;
import cn.yunhe.dao.IMessageDao;
import cn.yunhe.factory.SqlSessionFactoryUtil;
import cn.yunhe.model.message.Message;
import cn.yunhe.model.message.MessageToUser;

public class MessageBizImpl implements IMessageBiz {

	SqlSession session=null;
	public List<Message> noReadMessageNum(int userid) {
		session=SqlSessionFactoryUtil.getSqlSession();
		IMessageDao imd=session.getMapper(IMessageDao.class);
		List<Message> list=imd.messageNum(userid);
		return list;
	}

	
	public int addMassage(Message message) {
		session=SqlSessionFactoryUtil.getSqlSession();
		IMessageDao imd=session.getMapper(IMessageDao.class);
		int messageid=imd.addMassage(message);
		return messageid;
	}

	
	public int addMassageToUser(MessageToUser mess2u) {
		session=SqlSessionFactoryUtil.getSqlSession();
		IMessageDao imd=session.getMapper(IMessageDao.class);
		int messagetouser=imd.addMassageToUser(mess2u);
		return messagetouser;
	}


	
	public List<Message> allMessageNum(int userid) {
		
		return null;
	}

}
